4.Primary key - uniquely describes each record in a table and is related to each column of information
5.Foreign key - to cross reference tables by being in two tables
6.Updating - Can always change fields, add new records, or delete old ones
7.Relational Database - A database that maintains separate, related fields, but combines data elements from the files for queries and reports
II. What are databases and their rules?
Databases are used to store and retrieve information in a safe and time economic way. All databases tend to follow 3 specific rules known as the first, second, and third normal forms. The first form
indicates that no repeating columns of data or duplicate rows of data be apparent. Each column in a table must consist of unique data. The seond normal form states that each attribute is
dependant on the entire primary key, a column of data that is connected in terms of relevant information needed to narrow out information in other columns of data in the table. The third form says
each attribute is ONLY dependent on the primary key which is quite like the 2nd form however it specificly says that each column of data is directly linked in relevancy to the primary key and no
other column of data. In order to get data from one column, one must look at the primary key first.
Here is a bad table and how you may fix it.
This table is bad design. There is repeating information(Employer/Working hours). This is against the First Form, no repeating columns of data
This tables represent the same information and are better but still against the first form.
The workers First Name and Last Name are not related to the Employer at all therefore is bad. This is still against the second and third form
The following tables is the correct way to do it:
All the information is correctly showed and follows the 3 forms.
Rules to Entity Relationships (ER) Diagrams:
Rule 1 - A primary key can never contain a null value(no real value)
Rule 2 - A non-primary key can contain a null value(no real value)
*An ER diagram also known as an Entity Relationship diagram is a much more organised way top show data.
There are different relationships in Entity Relationships (ER) Diagrams. One to One, One to many, and many to many. One to one relation ship is when only one entity only has one value. For
example one person has one first name. One to many relationships are when one entity has one value while the other has many values. For example one person may have many cars, one
person equals one value, and many cars equals many values. However one should never have many to many relationships between tables. When this occurs you have to break it down by adding
another table in between them to make it into one to many.
Devin
Guillermo
I.Some useful terms:
1.Fields - single unit of data stored in a record
2.Records - rows in a table
3.Query - to search/retrieve information
4.Primary key - uniquely describes each record in a table and is related to each column of information
5.Foreign key - to cross reference tables by being in two tables
6.Updating - Can always change fields, add new records, or delete old ones
7.Relational Database - A database that maintains separate, related fields, but combines data elements from the files for queries and reports
II. What are databases and their rules?
Databases are used to store and retrieve information in a safe and time economic way. All databases tend to follow 3 specific rules known as the first, second, and third normal forms. The first form
indicates that no repeating columns of data or duplicate rows of data be apparent. Each column in a table must consist of unique data. The seond normal form states that each attribute is
dependant on the entire primary key, a column of data that is connected in terms of relevant information needed to narrow out information in other columns of data in the table. The third form says
each attribute is ONLY dependent on the primary key which is quite like the 2nd form however it specificly says that each column of data is directly linked in relevancy to the primary key and no
other column of data. In order to get data from one column, one must look at the primary key first.
Here is a bad table and how you may fix it.
This table is bad design. There is repeating information(Employer/Working hours). This is against the First Form, no repeating columns of data
This tables represent the same information and are better but still against the first form.
The workers First Name and Last Name are not related to the Employer at all therefore is bad. This is still against the second and third form
The following tables is the correct way to do it:
All the information is correctly showed and follows the 3 forms.
Rules to Entity Relationships (ER) Diagrams:
Rule 1 - A primary key can never contain a null value(no real value)
Rule 2 - A non-primary key can contain a null value(no real value)
*An ER diagram also known as an Entity Relationship diagram is a much more organised way top show data.
There are different relationships in Entity Relationships (ER) Diagrams. One to One, One to many, and many to many. One to one relation ship is when only one entity only has one value. For
example one person has one first name. One to many relationships are when one entity has one value while the other has many values. For example one person may have many cars, one
person equals one value, and many cars equals many values. However one should never have many to many relationships between tables. When this occurs you have to break it down by adding
another table in between them to make it into one to many.
This is very good example of a ER Diagram